class Dice:
    def __init__(self):
        self.iSides = 6
        self.rolls = []
    def rollDice(self):
        r = random.randint(1,self.iSides)
        self.rolls.append(r)
        return r
    def sideCount(self,side):
        return self.rolls.count(side)
    def rollCount(self):
        return len(self.rolls)
    

import random
import time
random.seed(0)   #设置随机数种子，以便让执行结果固定
#random.seed(time.time())   #设置随机数种子，以便让执行结果随机
d = Dice()
print("-----Roll dice for 100 times-----")
for x in range(100):
    r = d.rollDice()
    if x < 10:
        print(r,end=",") 
print("...")

print("-----Statistics of rolling the dice-----")
for i in range(1,d.iSides+1):
    sideCount = d.sideCount(i)
    rollCount = d.rollCount()
    print(f"Side {i}: {sideCount}/{rollCount} = "\
        f"{sideCount*100/rollCount:.1f}%")
